'use strict';

const Service = require('egg').Service;

class LiveService extends Service {
    async checkStatus(id) {
        let live = await this.app.model.Live.findOne({
            where: {
                id
            }
        })
        if (!live) {
            return "直播间不存在"

        }
        if(live.status == 0){
            return "直播间未开播"
        }
        if(live.status == 3){
            return "直播间已结束"
        }
        return false
    }
}
module.exports = LiveService;
